

from mycelery.main import app
from luffyapi.libs.yuntongxun.sms import CCP
from luffyapi.settings import contants
import logging
logger = logging.getLogger('django')
@app.task
def send_sms(sms_code,mobile):
    """ 发送短信任务 """

    ccp = CCP()
    ret = ccp.send_template_sms('18800140015', [sms_code, contants.SMS_EXPIRE_TIME // 60], 1)

    if not ret:
        logger.error("%s 发送短信失败" % mobile)


